package com.ad_hccm.dao;

import com.ad_hccm.domain.LifeQuality;
import com.ad_hccm.domain.PatientUser;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * TODO 皮肤病生活质量表Dao
 */
@Mapper
public interface LifeQualityDao {
    @Insert("insert into life_quality value(#{id}, #{itching}, #{awkward}, #{activity}, #{wear}, #{socialize}, #{sports}, #{isWork}, #{work}, #{friend}, #{sex}, #{treatment})")
    public boolean save(LifeQuality lifeQuality);

    @Update("update life_quality set itching = #{itching}, awkward = #{awkward}, activity = #{activity}, wear = #{wear}, socialize = #{socialize}, sports = #{sports}, isWork = #{isWork}, work = #{work}, friend = #{friend}, sex = #{sex}, treatment = #{treatment} where id=#{id}")
    public boolean update(LifeQuality lifeQuality);

    @Select("select * from life_quality where id=#{id}")
    public LifeQuality getById(String id);

    @Select("select * from life_quality")
    public List<LifeQuality> getAll();

}